package com.itheima.Test02;

import java.io.FileReader;
import java.io.FileWriter;
import java.util.Properties;
import java.util.Set;

public class Test001 {
    public static void main(String[] args) throws Exception {
        Properties p = new Properties();
        p.load(new FileReader("KuoZhanTest\\student.txt"));
        //System.out.println(p);
        //获取所有的键;
        Set<String> strings = p.stringPropertyNames();
        for (String string : strings) {
            if (string.equals("刘方")) {
                p.setProperty("刘方","18");
            }
        }
        p.store(new FileWriter("KuoZhanTest\\123.properties"),"...");

    }
}
